package com.csc.controller;

import org.springframework.security.crypto.bcrypt.BCrypt;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class PasswordEncoderGenerator {
	public static void main(String[] args) {

		BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
		String password = "123456";
		int i = 0;
		while (i < 10) {
			String pw_hash = BCrypt.hashpw(password, BCrypt.gensalt());
			String hashedPassword = passwordEncoder.encode(password);
			System.out.println(hashedPassword);
			System.out.println("\n" + pw_hash);
			i++;
		}

		if (BCrypt.checkpw("rrrrr",
				"$2a$10$3FWF.BDACXHU52n1Ruqmz.1Yv1LcIuxjXeia2oA/atgvL.10p9.eS"))
			System.out.println("OK");
	}
}
